<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>

<body>
<script type='module'>
    import {Person, name, age, sayName} from './modules/index.js';

    console.log(name);
    console.log(age);
    console.log(sayName());

    let p = new Person('marry', 21);
    console.log(p);

    import * as all from './modules/index.js';
    console.log(all);//这里的 a是index.js的整个模块
</script>
</body>

</html>
